<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vue-router.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<router-link to="/news/1/福建福州">福建福州至诚学院</router-link>
			<router-link to="/news/2/中国建设银行">中国建设银行来到校园</router-link>
			
			<router-view></router-view>
		</div>
	</body>
</html>
<script type="text/javascript">
	var news = {
		template:`
					<h1>新闻编号:{{this.$route.params.id}}<br/>
						新闻标题:{{this.$route.params.title}}
					</h1>
				`
	}
	
	var router = new VueRouter({
		routes:[
			{
				path:'/news/:id/:title',
				component:news
			}
		]
	})
	
	var vm = new Vue({
		el:"#app",
		router:router
	})
</script>
